package com.css.zfzx.sjcj.modules.yhdisaster.service.impl;

import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
import com.css.zfzx.sjcj.modules.yhdisaster.params.ExportDisasterEvaluateParams;
import com.css.zfzx.sjcj.modules.yhdisaster.repository.YhDisasterNativeRepository;
import com.css.zfzx.sjcj.modules.yhdisaster.repository.entity.YhDisasterEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DisasterEvaluationExportServer implements IExcelExportServer {

    private final YhDisasterNativeRepository<YhDisasterEntity> yhDisasterNativeRepository;

    @Autowired
    public DisasterEvaluationExportServer(YhDisasterNativeRepository<YhDisasterEntity> yhDisasterNativeRepository) {
        this.yhDisasterNativeRepository = yhDisasterNativeRepository;
    }

    @Override
    public List<Object> selectListForExcelExport(Object queryParams, int page) {
        ExportDisasterEvaluateParams params = (ExportDisasterEvaluateParams) queryParams;
        return yhDisasterNativeRepository.queryDisasterEvaluate(params, page);
    }

}
